package fr.emse.tatiana.replayable.analysis;

import fr.emse.tatiana.replayable.Anchor;

public class Link {
	private IGraphAnalysis ga;
	private Anchor source;
	private Anchor target;
	private int type;
	private String desc;
	public Link(Anchor src, Anchor target, int type, String desc, IGraphAnalysis ga) {
		this.source = src;
		this.target = target;
		this.type = type;
		this.desc = desc;
		this.ga = ga;
	}
	public Anchor getSource() {
		return source;
	}
	public void setSource(Anchor src) {
		this.source = src;
	}
	public Anchor getTarget() {
		return target;
	}
	public void setTarget(Anchor target) {
		this.target = target;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
		ga.updateLink(this);
	}
	public void delete() {
		ga.removeLink(this);
		
	}
}
